package com.lipengcheng.user.utils;

public class UserHolder {
    private static final ThreadLocal<Long> threadLocal=new ThreadLocal<>();
    //提供一个set方法
    public static void setUserId(Long userId){
        threadLocal.set(userId);
    }
    //提供一个get方法
    public static Long getUserId(){
        return threadLocal.get();
    }
    public static void removeUser(){
        threadLocal.remove();
    }
}
